<el-container class="home">
  <!-- header -->
  <el-header class="header">
    <el-row type="flex" class="row-bg" justify="space-between">
      <el-col :span="6" class="col-1"><img src="@/assets/images/logo.png" alt=""></el-col>
      <el-col :span="6" class="col-2">电商后台管理系统</el-col>
      <el-col :span="4" class="col-3">欢迎上海前端27期星曜会员<a href="javascript:;" @click.prevent="logout">退出</a></el-col>
    </el-row>
  </el-header>
  <el-container>
    <!-- aside -->
    <el-aside width="200px" class="aside">
      <!-- default-active="/users" -->
      {{ $route.path }}
      <el-menu
        :default-active="'/' + $route.path.split('/')[1]"
        :router="true"
        class="el-menu-vertical-demo"
        background-color="#545c64"
        text-color="#fff"
        active-text-color="#ffd04b"
        unique-opened
        >
      <!-- 第一个 -->
        <el-submenu :index="level1.id.toString()" v-for="level1 in menuList" :key="level1.id">
          <template slot="title">
            <i class="el-icon-location"></i>
            <span>{{ level1.authName }}</span>
          </template>
          <el-menu-item :index="'/' + level2.path" v-for="level2 in level1.children" :key="level2.id">
              <i class="el-icon-menu"></i>
              <span slot="title">{{ level2.authName }}</span>
            </el-menu-item>
        </el-submenu>
      </el-menu>
    </el-aside>
    <!-- main -->
    <el-main class="main">
      <router-view></router-view>
    </el-main>
  </el-container>
</el-container>
